
var Vm_company=new Vue({
    el:'.index',
    data:{province:'',
        city:'',enterprise_scale :''},
    methods: {
        company_check_ajax: function (data) {
            var _self=this;
            console.log(url_web+'sys/company')
            $.ajax({
                url: './testdata.json',
                dataType: "json",type:'get',data:{"pageSize":10,"pageNum" :0,"code":null,
                    "letterState":null,"sendType":null},
                xhrFields: {
                    withCredentials: true
                }, crossDomain: true,
                success: function(data){
                    console.log(data)
                    /*if(data.success){
                        _self.index=data;
                        _self.platform_name=data.data.title;
                        _self.sys_icon=url_operate+data.data.runAttachment.fullName;
                    }else{
                        alert(data.msg);
                    }*/
                },
                error: function(data){
                    console.log("页面加载失败!");
                }
            });
        }
    },
    created:function() {
        this.company_check_ajax();
    }
});

/*$.validator.addMethod("pwd", function(value, element, param){
    //方法中又有三个参数:value:被验证的值， element:当前验证的dom对象，param:参数(多个即是数组)
//      console.log(value + "," + $(element).val() + "," + param );
    return new RegExp(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,}$/).test(value);
});*/
 // step1填写联系方式
$(".step_3 form").validate({
    rules: {
        currPass: {
            required: !0,
            pwd:true
        },
        newPass: {
            required: !0,
            pwd:true
        },
        rePass: {
            equalTo:"#newPass"
        }
    },
    messages: {
        currPass: {
            required: e + "请输入您的原始密码",
            pwd: e + "密码必须由8以上的数字和字母组成"
        },
        newPass: {
            required: e + "请输入您的新密码",
            pwd: e + "密码必须由8以上的数字和字母组成"
        },
        rePass: {
            equalTo: e + "两次密码输入不一致"
        }
    },
    submitHandler: function (form) {
        var $form = $(form),
        data = $form.serialize();
        console.log(data)
        $.ajax({
            type : "post",xhrFields: {
                withCredentials: true
            },
            crossDomain: true,
            url : "./testdata.json",
            data : data,
            success : function(data) {
                console.log(data)
                console.log($(this))
                $(".steps").addClass('hidden');
                $(".step_3").addClass('hidden');
                $(".step_4").removeClass('hidden');
                // $(".step_1").addClass('hidden');
                // $(".step_2").removeClass('hidden');

                /*if(data.success){
                    // alert('密码修改成功！')
                    // window.location.href='index.html'
                }else {
                    alert(data.msg)
                }*/
            },
            error : function(){
                alert("请求失败!");
            }
        });
    }
});